<%@ page import="service.AdminService" %>
<%@ page import="domain.NewsType" %>
<%@ page import="java.util.List" %>
<%--
  Created by IntelliJ IDEA.
  User: HUAWEI
  Date: 2024/1/2
  Time: 21:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    List<NewsType> newsTypeList1 = AdminService.getNewsType();
    request.setAttribute("newsTypeList1",newsTypeList1);
%>
<html>
<head>
    <title>新闻添加</title>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>

    <style>
        /* 设置a标签样式*/
        a {
            color: black; /* 设置字体为白色 */
        }

        a:hover {
            color: red;
            text-decoration: none; /* 去除下划线效果 */
        }
    </style>

</head>
<body>
<%@include file="header.jsp" %>

<div class="row" style="padding-top: 20px">
    <div class="col"></div>
    <div class="col-6">
        <form method="post" action="addNews" enctype="multipart/form-data">
            <div class="form-group">
                <p>
                    <label for="Title" style="float: left">选择新闻类型</label><label
                        style="color:red;float: left">*</label>
                    <select class="form-control" name="newsTypeId">
                        <c:forEach items="${newsTypeList1}" var="news">
                            <option value="${news.newsTypeId}">${news.newsTypeName}</option>
                        </c:forEach>

                    </select>
                </p>
                <p>
                    <label for="Title" style="float: left">新闻标题</label><label
                        style="color:red;float: left">*</label>
                    <input type="text" class="form-control" id="Title" name="title"
                    <%--value="${not empty admin_login_req ? admin_login_req : ""}"--%>>
                </p>
                <p>
<%--                    <label for="content" style="float: left">新闻内容</label><label--%>
<%--                        style="color:red;float: left">*</label>--%>
<%--                    <input type="text" class="form-control" id="content" name="content"--%>
<%--                    &lt;%&ndash;value="${not empty admin_login_req ? admin_login_req : ""}"&ndash;%&gt;>--%>

                    <label for="exampleFormControlTextarea1">新闻内容</label><label
                        style="color:red;float: left">*</label>
                    <textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="content"></textarea>
                </p>
                <p>

                    <label for="Title" style="float: left">选择发布日期</label><label
                        style="color:red;float: left">*</label><br/><br/>
                    <input type="datetime-local" id="datetime" name="datetime"/>
                </p>
                <p>
                    <label for="Title" style="float: left">上传图片</label><label
                        style="color:red;float: left">*</label>
                    <input type="file" class="form-control-file" id="exampleFormControlFile1" name="file">
                </p>
                <p>
                    <input type="submit" class="btn btn-danger btn-lg btn-block" value="添 加">
                </p>
            </div>
        </form>
    </div>
    <div class="col"></div>
</div>
</body>
</html>


